package p270jp.pxv.android.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import androidx.databinding.DataBindingUtil;
import java.util.List;
import p090d0.C2518n;
import p134ei.AnalyticsAction;
import p270jp.pxv.android.R;
import p270jp.pxv.android.model.AppApiSketchLive;
import p270jp.pxv.android.model.AppApiSketchLivePerformer;
import p307l9.EdgeTreatment;
import p314lg.ViewLiveModuleBinding;
import p325m0.MutabilityOwnership;
import p347mm.MuteManager;
import p374nm.BaseMuteLayout;
import p374nm.View$OnClickListenerC5388c0;
import p547uh.View$OnLongClickListenerC6549s6;
import p677zi.PixivImageLoader;

/* renamed from: jp.pxv.android.view.LiveModuleView */
/* loaded from: classes2.dex */
public class LiveModuleView extends BaseMuteLayout {

    /* renamed from: d */
    public static final /* synthetic */ int f19552d;

    /* renamed from: b */
    public ViewLiveModuleBinding f19553b;

    /* renamed from: c */
    public PixivImageLoader f19554c = (PixivImageLoader) C2518n.m7641d(PixivImageLoader.class);

    public LiveModuleView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    @Override // p374nm.BaseMuteLayout
    /* renamed from: a */
    public View mo3337a() {
        ViewLiveModuleBinding v9Var = (ViewLiveModuleBinding) DataBindingUtil.m11370c(LayoutInflater.from(getContext()), R.layout.view_live_module, this, false);
        this.f19553b = v9Var;
        return v9Var.f2666e;
    }

    /* renamed from: c */
    public void m4489c(AppApiSketchLive appApiSketchLive, AnalyticsAction aVar) {
        EdgeTreatment.m3909i(appApiSketchLive);
        MutabilityOwnership.m3745m(appApiSketchLive, "live");
        if (appApiSketchLive.isMuted || MuteManager.f23061h.m3540c(appApiSketchLive.owner.user.f19078id)) {
            setMuteCoverVisibility(0);
            return;
        }
        setMuteCoverVisibility(8);
        this.f19553b.mo3770z(appApiSketchLive);
        List<AppApiSketchLivePerformer> performersIncludeOwner = appApiSketchLive.getPerformersIncludeOwner();
        if (performersIncludeOwner.size() >= 4) {
            this.f19553b.f22360x.setVisibility(0);
            this.f19554c.m60f(getContext(), performersIncludeOwner.get(3).user.profileImageUrls.getMedium(), this.f19553b.f22360x);
        } else {
            this.f19553b.f22360x.setVisibility(8);
        }
        if (performersIncludeOwner.size() >= 3) {
            this.f19553b.f22359w.setVisibility(0);
            this.f19554c.m60f(getContext(), performersIncludeOwner.get(2).user.profileImageUrls.getMedium(), this.f19553b.f22359w);
        } else {
            this.f19553b.f22359w.setVisibility(8);
        }
        if (performersIncludeOwner.size() >= 2) {
            this.f19553b.f22358v.setVisibility(0);
            this.f19554c.m60f(getContext(), performersIncludeOwner.get(1).user.profileImageUrls.getMedium(), this.f19553b.f22358v);
        } else {
            this.f19553b.f22358v.setVisibility(8);
        }
        if (performersIncludeOwner.size() >= 1) {
            this.f19553b.f22357u.setVisibility(0);
            this.f19554c.m60f(getContext(), performersIncludeOwner.get(0).user.profileImageUrls.getMedium(), this.f19553b.f22357u);
        } else {
            this.f19553b.f22357u.setVisibility(8);
        }
        setOnClickListener(new View$OnClickListenerC5388c0(this, aVar, appApiSketchLive, 0));
        setOnLongClickListener(new View$OnLongClickListenerC6549s6(appApiSketchLive, 1));
    }

    public ViewLiveModuleBinding getBinding() {
        return this.f19553b;
    }

    public void setCroppedInternalTitleVisibility(int i) {
        this.f19553b.f22353q.setVisibility(i);
    }

    public void setFullInternalTitleVisibility(int i) {
        this.f19553b.f22354r.setVisibility(i);
    }
}
